package com.corona.game;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.corona.Game;
import com.corona.game.util.TextureCache;
import com.sun.jna.platform.win32.WinError;
import java.util.ArrayList;

/* compiled from: Battle.java */
/* access modifiers changed from: package-private */
/* loaded from: pokewilds.jar:com/pkmngen/game/BattleIntroAnim1.class */
public class BattleIntroAnim1 extends Action {
    Sprite frame;
    Sprite bgSprite;
    public Action.Layer layer = Action.Layer.gui_139;
    ArrayList<Sprite> frames = new ArrayList<>();

    public BattleIntroAnim1(Action nextAction) {
        super(new Object[0]);
        this.nextAction = nextAction;
        Texture text = TextureCache.get(Gdx.files.internal("battle/battle_intro_anim1_sheet1.png"));
        for (int i = 0; i < 28; i++) {
            this.frames.add(new Sprite(text, i * 160, 0, 160, 144));
        }
        for (int i2 = 0; i2 < 42; i2++) {
            this.frames.add(new Sprite(text, (int) WinError.ERROR_REQUEST_REFUSED, 0, 160, 144));
        }
        this.bgSprite = new Sprite(TextureCache.get(Gdx.files.internal("battle/intro_frame3.png")), 0, 0, 160, 144);
    }

    @Override // com.corona.game.Action
    public String getCamera() {
        return "gui";
    }

    @Override // com.corona.game.Action
    public Action.Layer getLayer() {
        return this.layer;
    }

    @Override // com.corona.game.Action
    public void step(Game game) {
        if (this.frames.isEmpty()) {
            game.insertAction(this.nextAction);
            game.actionStack.remove(this);
            this.nextAction.step(game);
            return;
        }
        this.frame = this.frames.get(0);
        if (this.frame != null) {
            this.frame.draw(game.uiBatch);
        }
        this.frames.remove(0);
        game.uiBatch.draw(this.bgSprite, -160.0f, 0.0f);
        game.uiBatch.draw(this.bgSprite, 160.0f, 0.0f);
        game.uiBatch.draw(this.bgSprite, 0.0f, -144.0f);
        game.uiBatch.draw(this.bgSprite, 0.0f, 144.0f);
    }
}
